#include <iostream>
#include <cstring>
#include <algorithm>

using namespace std;

const int N = 1e5 + 10;

int n, m;
int num[N];
int dp[N];

int main()
{
    cin >> m;
    while (m -- )
    {
        cin >> n;
        for (int i = 1; i <= n; i ++ ) cin >> num[i];
        dp[1] = num[1];
        for (int i = 2; i <= n; i ++ ) dp[i] = max(dp[i - 1], dp[i - 2] + num[i]);
        cout << dp[n] << endl;
    }
    
    return 0;
}
